Skip to content

branch-4.0: [fix](filecache) Disable sync file cache clear in http api(pick#64321)#64460

Merged
morningman merged 2 commits into
apache:branch-4.0from
freemandealer:pick-branch-4.0-pr-64321-20260612
Jun 24, 2026
Merged

branch-4.0: [fix](filecache) Disable sync file cache clear in http api(pick#64321)#64460
morningman merged 2 commits into
apache:branch-4.0from
freemandealer:pick-branch-4.0-pr-64321-20260612

Conversation

@freemandealer

Copy link
Copy Markdown
Member

Pick from #64321

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: The file cache HTTP clear endpoint allowed callers to request synchronous clear with sync=true. The synchronous clear path is kept for unit tests and internal callers, but it is not safe to expose through the HTTP API. This change makes the HTTP op=clear endpoint always use async clear. The default behavior remains async, and explicit sync=true returns a warning message while still running async clear. Segment-specific HTTP clear also uses async remove instead of the synchronous remove path.

### Release note

The BE /api/file_cache?op=clear HTTP API no longer supports synchronous clearing. Requests with sync=true now run async clear and return a warning message.

### Check List (For Author)

- Test: Unit Test
    - DORIS_TOOLCHAIN=clang DISABLE_BE_JAVA_EXTENSIONS=ON ENABLE_INJECTION_POINT=ON ENABLE_CACHE_LOCK_DEBUG=0 ENABLE_PCH=0 sh run-be-ut.sh --run --filter=FileCacheActionTest.*
- Behavior changed: Yes. HTTP file cache clear no longer exposes synchronous clear.
- Does this need documentation: No

(cherry picked from commit 29d3a6f)
Picked-from: apache#64321
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@freemandealer

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/8) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.48% (25528/35711)
Line Coverage 54.34% (270617/497962)
Region Coverage 52.13% (225099/431834)
Branch Coverage 53.43% (96690/180959)

@freemandealer

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (8/8) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.35% (19461/36478)
Line Coverage 36.47% (181933/498845)
Region Coverage 33.06% (141322/427525)
Branch Coverage 33.92% (61178/180336)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/8) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.48% (25526/35709)
Line Coverage 54.35% (270653/497971)
Region Coverage 52.05% (224768/431843)
Branch Coverage 53.43% (96684/180969)

@morningman morningman merged commit cde9d53 into apache:branch-4.0 Jun 24, 2026
27 of 31 checks passed
@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants